package com.example.java8.timeapi;

import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;

public class ZONETest {
    public static void main(String[] args) {
        zoneTest();
    }

    private static void zoneTest() {
        //查看可用zone
//        ZoneId.getAvailableZoneIds().stream().forEach(System.out::println);
        LocalDateTime localDateTime = LocalDateTime.now(ZoneId.of("Asia/Shanghai"));
        System.out.println(localDateTime);
        System.out.println(LocalDateTime.ofInstant(Instant.now(), ZoneId.of("Etc/UTC")));

    }
}
